﻿<%@ Page Language="C#" MasterPageFile="~/Pages/MainPage.Master" AutoEventWireup="true"
    CodeBehind="RoleManagement.aspx.cs" Inherits="ContractManagermentSystem.Pages.RoleManagement"
    Title="Role Management" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 204px;
        }
        .style3
        {
            width: 529px;
        }
    </style>
    <style type="text/javascript">
        function confirmDelete()
        {
            return: cconfirm( "Are you sure to delete this role ?" );
        }
        function setPage(hId, index)
        {
            document: ..getElementById(hId).value=index;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <table>
        <tr>
            <td>
                <asp:HyperLink ID="HomeHyperLink" runat="server" NavigateUrl="#">Home</asp:HyperLink>
&nbsp;<asp:ImageButton ID="ImageButton" runat="server" 
                    ImageUrl="~/Presentation/Images/navbit.png" />
&nbsp;<asp:HyperLink ID="RoleManagementHyperLink" runat="server" Font-Bold="True" 
                    NavigateUrl="~/Pages/RoleManagement.aspx">Role Management</asp:HyperLink>
&nbsp;
            </td>
        </tr>
    </table>
    <h1>
        Manager Role</h1>
    <table class="style1" cellpadding="2" cellspacing="2">
        <tr>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td style="text-align: left">
                <table class="style1">
                    <tr>
                        <td class="style2">
                            &nbsp;
                        </td>
                        <td class="style3">
                            <asp:GridView ID="RoleGridView" runat="server" AutoGenerateColumns="False" BackColor="White"
                                BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" Style="text-align: left"
                                Width="527px" DataKeyNames="RoleId" OnSelectedIndexChanged="RoleGridView_SelectedIndexChanged"
                                OnRowDeleting="RoleGridView_RowDeleting" AllowPaging="True" OnPageIndexChanging="RoleGridView_PageIndexChanging"
                                PageSize="5">
                                <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                                <RowStyle BackColor="White" ForeColor="#003399" />
                                <Columns>
                                    <asp:BoundField DataField="RoleId" HeaderText="RoleId" Visible="False" />
                                    <asp:BoundField DataField="RoleName" HeaderText="Role Name" />
                                    <asp:TemplateField HeaderText="Status">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="StatusImageButton" runat="server" ImageUrl='<%# "~/Presentation/Images/" + Eval("Status") + ".png" %>'
                                                CommandName="Select" Height="16px" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Edit">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="UpdateImageButton" runat="server" ImageUrl="~/Presentation/Images/edit-file-icon.png"
                                                PostBackUrl='<%# Eval("RoleId", "~/Pages/UpdateRole.aspx?Id={0}") %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" ButtonType="Image"
                                        DeleteImageUrl="~/Presentation/Images/delete-icon.png" />
                                </Columns>
                                <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                                <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                            </asp:GridView>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="text-align: center">
                <asp:Button ID="CreateButton" runat="server" PostBackUrl="~/Pages/CreateRole.aspx"
                    Text="Create Role" />
            </td>
        </tr>
    </table>
</asp:Content>
